package com.gaoxk.distributeReq;

import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.ViewNameMethodReturnValueHandler;

import java.util.stream.Collectors;

public class CustomizedHandlerAdapter extends RequestMappingHandlerAdapter {
    @Override
    public void afterPropertiesSet() {
        super.afterPropertiesSet();
        setReturnValueHandlers(getReturnValueHandlers().stream().filter(
                h -> h.getClass() != ViewNameMethodReturnValueHandler.class
        ).collect(Collectors.toList()));
    }
}
